<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/jsp/declare.jsp" %>

<!DOCTYPE html>
<html>
<head>
	<base href="<%=basePath %>" />
	<title>信息-房客</title>
	<%@ include file="/common/jsp/common.jsp" %>
	
	<script>
	function clickStep($step, $preDiv, $thisDiv, index) {
		if ($preDiv.attr("id") == $thisDiv.attr("id"))
			return false;
		var $form = $preDiv.find("form");
		if (validateForm($form)) {
			doAjax({
				url: addFromUserName($form.attr("action")),
				data: $($form.serializeArray()).filter(function(){
					return !!this.value;
				}),
				success: function(json){
					if (json && json.success && json.pk)
						$form.find("[name='id']").val(json.pk);
	
					// 如果是最后一页，些显示所有都为完成状态
					if (index == $step.find("div[index]").size() - 1)
						$step.addClass("finish");
				}
			});
		} else if ($form.size()) {
			jAlert("信息填写不完整");
			return false;
		}
	}
	</script>
</head>
<body class="frame bgcolor">
	<div class="center">
		<div id="information" class="step"  data="['个人基本信息', '居住信息', '就业计生信息', '主要关系人信息']" currindex="${currIndex }"
			option="{onclick: clickStep}"></div>

		<div id="personalInformation" class="step-information-0">
			<form action="mvc/renter/saveImproveInformation.json" method="post" onsubmit="return false;">
				<input type="hidden" name="informationType" value="personalInformation" />
				<input type="hidden" name="id" value="${personalInformation.id }" />
				<div class="row">
					<input type="text" id="name" name="name" value="${personalInformation.name }" placeholder="姓名" option="{required: true}" maxlength="10" class="input" />
				</div>
				<div class="row">
					<input type="text" id="nationality" name="nationality" value="${personalInformation.nationality }" placeholder="名族" option="{required: true}" maxlength="25" class="input" />
				</div>
				<div class="row autoHeight">
					<input id="sex" name="sex" value="${personalInformation.sex }" placeholder="性别" data="[{text:'男', value: 1},{text:'女', value: 0}]" option="{singleSelect: true, required: true}" class="checkbox" />
				</div>
				<div class="row">
					<input type="text" id="phone" name="phone" value="${personalInformation.phone }" placeholder="联系电话" option="{required: true}" maxlength="20" class="input" />
				</div>
				<div class="row">
					<input type="text" id="height" name="height" value="${personalInformation.height }" placeholder="身高(cm)" option="{required: true}" maxlength="10" class="input" />
				</div>
				<div class="row">
					<input type="text" id="birthday" name="birthday" value="${personalInformation.birthday }" placeholder="出生日期(yyyy-MM-dd)" option="{required: true}" maxlength="15" class="input" />
				</div>
				<div class="row autoHeight">
					<input id="army_status" name="army_status" value="${personalInformation.army_status }" placeholder="服兵役情况" data="[{text:'未服兵役', value: 0},{text:'服现役', value: 1},{text:'预备役', value: 2},{text:'退出现役', value: 3}]" option="{singleSelect: true, required: true}" class="checkbox" />
				</div>
				<div class="row autoHeight">
					<input type="text" id="politics_status" name="politics_status" value="${personalInformation.politics_status }" placeholder="政治面貌" data="[{text: '群众', value: 1},{text: '中共党员', value: 2},{text: '团员', value: 3},{text: '民主党派', value: 4}]" option="{singleSelect: true, required: true}" class="checkbox" />
				</div>
				<div class="row">
					<input type="text" id="idcard" name="idcard" value="${personalInformation.idcard }" placeholder="公民身份号码" option="{required: true}" maxlength="18" class="input" />
				</div>
				<div class="row autoHeight">
					<input type="text" id="marital_status" name="marital_status" value="${personalInformation.marital_status }" placeholder="婚姻状况" data="[{text: '未婚', value: 0},{text: '已婚', value: 1},{text: '丧偶', value: 2},{text: '离婚', value: 3}]" option="{singleSelect: true, required: true}" class="checkbox" />
				</div>
				<div class="row">
					<input type="text" id="net_contact" name="net_contact" value="${personalInformation.net_contact }" placeholder="网络联系方式" maxlength="50" class="input" />
				</div>
				<div class="row autoHeight">
					<input type="text" id="education" name="education" value="${personalInformation.education }" placeholder="文化程度" data="[{text: '研究生', value: 8},{text: '本科', value: 7},{text: '大专或本科', value: 6},{text: '中专或中技', value: 5},{text: '技校', value: 4},{text: '高中', value: 3},{text: '初中', value: 2},{text: '小学', value: 1},{text: '文盲或半文盲', value: 0}]" option="{singleSelect: true, required: true}" class="checkbox" />
				</div>
				<div class="row">
					<input type="text" id="address" name="address" value="${personalInformation.address }" placeholder="常驻户口地址" option="{required: true}" maxlength="100" class="input" />
				</div>
				<div class="row autoHeight">
					<input type="text" id="vehicle" name="vehicle" value="${personalInformation.vehicle }" placeholder="交通工具" data="[{text: '无', value: 0},{text: '电动车', value: 1},{text: '摩托车', value: 2},{text: '汽车', value: 3},{text: '其他', value: 4}]" option="{singleSelect: true, required: true}" class="checkbox" />
				</div>
				<div class="row">
					<input type="text" id="license_no" name="license_no" value="${personalInformation.license_no }" placeholder="牌照号码" maxlength="20" class="input" />
				</div>
				<div class="row">
					<input type="button" value="下一步" class="register" source="information-1" />
				</div>
			</form>
		</div>
		<div id="residenceInformation" class="step-information-1">
			<form action="mvc/renter/saveImproveInformation.json" method="post" onsubmit="return false;">
				<input type="hidden" name="informationType" value="residenceInformation" />
				<input type="hidden" name="id" value="${residenceInformation.id }" />
				<div class="row">
					<input type="text" id="address" name="address" value="${residenceInformation.address }" placeholder="居住地址" option="{required: true}" maxlength="50" class="input" />
				</div>
				<div class="row">
					<input type="text" id="main_phone" name="main_phone" value="${residenceInformation.main_phone }" placeholder="房主电话" option="{required: true}" maxlength="20" class="input" />
				</div>
				<div class="row">
					<input type="text" id="main_name" name="main_name" value="${residenceInformation.main_name }" placeholder="房主姓名" option="{required: true}" maxlength="10" class="input" />
				</div>
				<div class="row autoHeight">
					<input type="text" id="regist_status" name="regist_status" value="${residenceInformation.regist_status }" placeholder="办证情况" data="[{text: '不领证', value: 0},{text: '首次领证', value: 1},{text: '换领补证', value: 2},{text: '持证变更', value: 3}]" option="{singleSelect: true, required: true}" class="checkbox" />
				</div>
				<div class="row">
					<input type="text" id="main_idcard" name="main_idcard" value="${residenceInformation.main_idcard }" placeholder="房主公民身份号码" option="{required: true}" maxlength="18" class="input" />
				</div>
				<div class="row autoHeight">
					<input type="text" id="source" name="source" value="${residenceInformation.source }" placeholder="住房来源" data="[{text: '租住', value: 1},{text: '借住', value: 2},{text: '自有', value: 3},{text: '其他', value: 4}]" option="{singleSelect: true, required: true}" class="checkbox" />
				</div>
				<div class="row autoHeight">
					<input type="text" id="type" name="type" value="${residenceInformation.type }" placeholder="居住类型" data="[{text: '单人居住', value: 1},{text: '多人居住', value: 2},{text: '家庭居住', value: 3},{text: '其他', value: 4}]" option="{singleSelect: true, required: true}" class="checkbox" />
				</div>
				<div class="row autoHeight">
					<input type="text" id="category" name="category" value="${residenceInformation.category }" placeholder="住房种类" data="[{text: '居民住宅', value: 1},{text: '集中式住房', value: 2},{text: '单位宿舍', value: 3},{text: '建筑工地', value: 4},{text: '旅馆式住房', value: 5},{text: '其他', value: 6}]" option="{singleSelect: true, required: true}" class="checkbox" />
				</div>
				<div class="row autoHeight">
					<input type="text" id="reasons" name="reasons" value="${residenceInformation.reasons }" placeholder="居住事由" data="[{text: '务工', value: 1},{text: '务农', value: 2},{text: '投资经商', value: 3},{text: '服务业', value: 4},{text: '就学', value: 5},{text: '探亲访友', value: 6},{text: '其他', value: 7}]" option="{singleSelect: true, required: true}" class="checkbox" />
				</div>
				<div class="row">
					<input type="text" id="reach_date" name="reach_date" value="${residenceInformation.reach_date }" placeholder="来本地日期(yyyy-MM-dd)" maxlength="15" class="input" />
				</div>
				<div class="row autoHeight">
					<input type="text" id="dwell_time" name="dwell_time" value="${residenceInformation.dwell_time }" placeholder="拟居住期限" data="[{text: '半年以下', value: 1},{text: '半年至五年', value: 2},{text: '五年以上', value: 3}]" option="{singleSelect: true}" class="checkbox" />
				</div>
				<div class="row">
					<input type="text" id="regist_date" name="regist_date" value="${residenceInformation.regist_date }" placeholder="登记日期(yyyy-MM-dd)" maxlength="15" class="input" />
				</div>
				<div class="row">
					<input type="button" value="下一步" class="register" source="information-2" />
				</div>
			</form>
		</div>
		<div id="careerBreedingInformation" class="step-information-2">
			<form action="mvc/renter/saveImproveInformation.json" method="post" onsubmit="return false;">
				<input type="hidden" name="informationType" value="careerBreedingInformation" />
				<input type="hidden" name="id" value="${careerBreedingInformation.id }" />
				<div class="row">
					<input type="text" id="service_name" name="service_name" value="${careerBreedingInformation.service_name }" placeholder="服务处所名称" option="{required: true}" maxlength="50" class="input" />
				</div>
				<div class="row">
					<input type="text" id="service_addredd" name="service_addredd" value="${careerBreedingInformation.service_addredd }" placeholder="服务处所地址" option="{required: true}" maxlength="50" class="input" />
				</div>
				<div class="row">
					<input type="text" id="unit_phone" name="unit_phone" value="${careerBreedingInformation.unit_phone }" placeholder="单位联系电话" option="{required: true}" maxlength="20" class="input" />
				</div>
				<div class="row autoHeight">
					<input type="text" id="unit_type" name="unit_type" value="${careerBreedingInformation.unit_type }" placeholder="产业类型" data="[{text: '农业', value: 1},{text: '工业', value: 2},{text: '服务业', value: 3},{text: '其他', value: 4}]" option="{singleSelect: true, required: true}" class="checkbox" />
				</div>
				<div class="row">
					<input type="text" id="work_date" name="work_date" value="${careerBreedingInformation.work_date }" placeholder="就业时间" option="{required: true}" maxlength="15" class="input" />
				</div>
				<div class="row autoHeight">
					<input type="text" id="labor_contract" name="labor_contract" value="${careerBreedingInformation.labor_contract }" placeholder="劳动合同签订情" data="[{text: '是', value: 1},{text: '否', value: 0}]" option="{singleSelect: true, required: true}" class="checkbox" />
				</div>
				<div class="row">
					<input type="text" id="children_num" name="children_num" value="${careerBreedingInformation.children_num }" placeholder="现有子女个数" maxlength="2" class="input" />
				</div>
				<div class="row autoHeight">
					<input type="text" id="insurance" name="insurance" value="${careerBreedingInformation.insurance }" placeholder="办理保险情况" data="[{text: '否', value: 0},{text: '是', value: 1},{text: '养老保险', value: 2},{text: '医疗保险', value: 3},{text: '失业保险', value: 4},{text: '工伤保险', value: 5},{text: '生育保险', value: 6},{text: '农保', value: 7}]" option="{singleSelect: true, required: true}" class="checkbox" />
				</div>
				<div class="row autoHeight">
					<input type="text" id="marry_birth_cer" name="marry_birth_cer" value="${careerBreedingInformation.marry_birth_cer }" placeholder="是否办理婚育证明" data="[{text: '是', value: 1},{text: '否', value: 0}]" option="{singleSelect: true, required: true}" class="checkbox" />
				</div>
				<div class="row">
					<input type="text" id="marry_birth_cerno" name="marry_birth_cerno" value="${careerBreedingInformation.marry_birth_cerno }" placeholder="婚育证明编号" maxlength="50" class="input" />
				</div>
				<div class="row">
					<input type="button" value="下一步" class="register" source="information-3" />
				</div>
			</form>
		</div>
		<div id="relatedInformation" class="step-information-3">
			<form action="mvc/renter/saveImproveInformation.json" method="post" onsubmit="return false;">
				<input type="hidden" name="informationType" value="relatedInformation" />
				<input type="hidden" name="id" value="${relatedInformation.id }" />
				<div class="row">
					<input type="text" id="name" name="name" value="${relatedInformation.name }" placeholder="姓名" option="{required: true}" maxlength="10" class="input" />
				</div>
				<div class="row autoHeight">
					<input type="text" id="sex" name="sex" value="${relatedInformation.sex }" placeholder="性别" data="[{text: '男', value: 1},{text: '女', value: 0}]" option="{singleSelect: true}" class="checkbox" />
				</div>
				<div class="row">
					<input type="text" id="birthday" name="birthday" value="${relatedInformation.birthday }" placeholder="出生日期(yyyy-MM-dd)" option="{required: true, required: true}" maxlength="15" class="input" />
				</div>
				<div class="row">
					<input type="text" id="idcard" name="idcard" value="${relatedInformation.idcard }" placeholder="公民身份号码" option="{required: true}" maxlength="18" class="input" />
				</div>
				<div class="row autoHeight">
					<input type="text" id="relation" name="relation" value="${relatedInformation.relation }" placeholder="与申请人关系" data="[{text: '配偶', value: 1},{text: '父母', value: 2},{text: '子女', value: 3},{text: '兄弟姐妹', value: 4},{text: '同事', value: 5},{text: '同乡', value: 6},{text: '其他', value: 7}]" option="{singleSelect: true, required: true}" class="checkbox" />
				</div>
				<div class="row">
					<input type="text" id="work_address" name="work_address" value="${relatedInformation.work_address }" placeholder="单位地址" option="{required: true}" maxlength="50" class="input" />
				</div>
				<div class="row">
					<input type="button" value="保　存" class="register" />
				</div>
			</form>
		</div>

	</div>
</body>
</html>
